Closed
Conversation
8sunyuan
commented
Dec 17, 2024
| depositSharesPerWithdrawal | ||
| ); | ||
| withdrawal.nonce = nonce; | ||
| nonce += 1; |
Contributor
Author
There was a problem hiding this comment.
Note: this was needed because it was looping over creating queuedWithdrawalParams but each one was having a nonce of 0 from reading directly off the contract. I overwrite this value here since the expectation is that the withdrawals are queued in order with nonces from 0-3 inclusive
Member
0xClandestine
left a comment
There was a problem hiding this comment.
one nit, ci is failing too
| // if the completion block is in the future, simply read current slashing factors | ||
| // still possible however for the slashing factors to change before the withdrawal is completable | ||
| // and the shares withdrawn to be less | ||
| if (completableBlock > uint32(block.number)) { |
Member
There was a problem hiding this comment.
nit: could be a ternary (no biggie tho)
Member
noticed it's also failing upstream, can fix if needed |
ypatil12
suggested changes
Dec 18, 2024
Contributor
ypatil12
left a comment
There was a problem hiding this comment.
Can we simplify this PR?
| if (completableBlock > uint32(block.number)) { | ||
| slashingFactors = | ||
| _getSlashingFactors({staker: staker, operator: operator, strategies: withdrawals[i].strategies}); | ||
| // Read slashing factors at the completable block |
Contributor
There was a problem hiding this comment.
Can we remove these from this PR
Contributor
|
Closing in favor of #965 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decided on removing numToComplete interface and this PR also fixes some broken tests.
Also fixes a race condition bug where a staker's withdrawal is still slashable in the same block that the withdrawal is completable, leading to possible race conditions. The regression test
test_getQueuedWithdrawals_SlashAfterWithdrawalCompletionon the view function found this and passes as a result of the fix.